package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author zmc
 * @description 权限菜单新增/修改请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("权限菜单新增/修改请求体")
public class PermissionSaveVO implements Serializable {

    private static final long serialVersionUID = -7818682833105336661L;

    /**
     * 权限id
     */
    @ApiModelProperty("权限id")
    @Null(message = "新增权限信息: 权限id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改权限信息: 权限id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改权限信息: 权限id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 权限名
     */
    @NotBlank(message = "新增权限信息: 权限名不能为空", groups = {AddGroup.class})
    @ApiModelProperty("权限名")
    private String permissionName;

    /**
     * 权限码
     */
    @NotBlank(message = "新增权限信息: 权限码不能为空", groups = {AddGroup.class})
    @ApiModelProperty("权限码")
    private String permissionCode;

    /**
     * 服务名
     */
    @NotBlank(message = "新增权限信息: 服务名不能为空", groups = {AddGroup.class})
    @ApiModelProperty("服务名")
    private String serverName;

    /**
     * 请求地址
     */
    @NotBlank(message = "新增权限信息: 请求地址不能为空", groups = {AddGroup.class})
    @ApiModelProperty("请求地址")
    private String url;

    /**
     * 描述
     */
    @ApiModelProperty("描述")
    private String description;

}
